<?php 
/*
function send_post($url, $post_data) {  
  
  $postdata = http_build_query($post_data);  
  $options = array(  
    'http' => array(  
      'method' => 'POST',  
      'header' => 'Content-type:application/x-www-form-urlencoded',  
      'content' => $postdata,  
      'timeout' => 15 * 60 // 超时时间（单位:s）  
    )  
  );  
  $context = stream_context_create($options);  
  $result = file_get_contents($url, false, $context);  
  
  return $result;  
}  


$post_data = array(  
  'tracer' => $tracer,  
  'name' => $name  
);  
send_post('http://113.215.1.161/cgi-bin/WDGD.py', $post_data); 
*/

$tracer=$_POST["tracer"];//接收测试机post来的检测结果，html table格式
$name=$_POST["name"];//接收测试机post的广电名称，例如关系广电
echo $tracer;//回显
echo $name;
$filename="/var/www/html/chuanmeiDD/res/".$name.".html";//广电对应的文件名与路径
echo $filename;
$myfile = fopen($filename, "w") or die("Unable to open file!");//打开或新建外地广电对应的html文件，写入检测结果到对于的文件
$txt = $tracer;
fwrite($myfile, $txt);
fclose($myfile);


  
 
echo "ok";//
?>

